"""
URL configuration for TravelProject project.

The `urlpatterns` list routes URLs to views. For more information please see:
    https://docs.djangoproject.com/en/5.2/topics/http/urls/
Examples:
Function views
    1. Add an import:  from my_app import views
    2. Add a URL to urlpatterns:  path('', views.home, name='home')
Class-based views
    1. Add an import:  from other_app.views import Home
    2. Add a URL to urlpatterns:  path('', Home.as_view(), name='home')
Including another URLconf
    1. Import the include() function: from django.urls import include, path
    2. Add a URL to urlpatterns:  path('blog/', include('blog.urls'))
"""
from django.contrib import admin
from django.urls import path
from web_app import views
from django.urls import path, include
from django.urls import path

from django.urls import path
from django.contrib.auth.views import (
    PasswordResetDoneView,
    PasswordResetCompleteView
)
from web_app import views  # 导入web_app应用的views
from django.urls import path, re_path  # 确保包含 re_path

from web_app.models import CustomUser

urlpatterns = [
    #path('admin/', admin.site.urls),
    path('user/logout/api/', views.user_logout_view, name='user_logout_api'),
    path('user/logout/', views.user_logout, name='logout'),

    path('scenery/', views.scenery, name='scenery'),

    path('base/', views.base, name='base'),


    path('search/results/', views.search_results),
    path('user/login/', views.user_login,name='user_login'),

    path('user/strategy/', views.user_strategy),
    path('register/', views.register, name='register'),
    path('travel/group/', views.travel_group, name='travel_group'),
    path('travel/', views.travel, name='travel'),

    path('house/', views.house, name='house'),
    path('itinerary/', views.itinerary, name='itinerary'),
    path('user/profile/',views.user_profile, name='user_profile'),

    path('user/collections/',views.user_collections, name='user_collections'),

    path('user/settings/',views.user_settings,name='user_settings'),
    path('user/message/reminder/', views.user_message_reminder),

    path('user/strategy/', views.user_strategy, name='user_strategy'),  # 添加这行

    path('search/', views.search, name='search'),  # 原搜索页面
    path('search/results/', views.search_results, name='search_results'),  # 结果页
    path('api/baichuan/search/', views.baichuan_search_api, name='baichuan_search_api'),  # 中转API

    re_path(r'^api/login/$', views.login_view, name='login_api'),

    # 收藏相关API
    path('api/favorites/check-all/', views.check_all_favorites, name='check_all_favorites'),
    path('api/favorites/add/<int:strategy_id>/', views.add_favorite, name='add_favorite'),
    path('api/favorites/remove/<int:strategy_id>/', views.remove_favorite, name='remove_favorite'),

    # 收藏列表页面
    path('user/favorites/', views.favorite_list, name='favorite_list'),

]
